276 research outputs found
Reversible Computation in Term Rewriting
Essentially, in a reversible programming language, for each forward
computation from state to state , there exists a constructive method to
go backwards from state to state . Besides its theoretical interest,
reversible computation is a fundamental concept which is relevant in many
different areas like cellular automata, bidirectional program transformation,
or quantum computing, to name a few.
In this work, we focus on term rewriting, a computation model that underlies
most rule-based programming languages. In general, term rewriting is not
reversible, even for injective functions; namely, given a rewrite step , we do not always have a decidable method to get from
. Here, we introduce a conservative extension of term rewriting that
becomes reversible. Furthermore, we also define two transformations,
injectivization and inversion, to make a rewrite system reversible using
standard term rewriting. We illustrate the usefulness of our transformations in
the context of bidirectional program transformation.Comment: To appear in the Journal of Logical and Algebraic Methods in
Programmin
From Reversible Computation to Checkpoint-Based Rollback Recovery for Message-Passing Concurrent Programs
The reliability of concurrent and distributed systems often depends on some
well-known techniques for fault tolerance. One such technique is based on
checkpointing and rollback recovery. Checkpointing involves processes to take
snapshots of their current states regularly, so that a rollback recovery
strategy is able to bring the system back to a previous consistent state
whenever a failure occurs. In this paper, we consider a message-passing
concurrent programming language and propose a novel rollback recovery strategy
that is based on some explicit checkpointing primitives and the use of a
(partially) reversible semantics for rolling back the system
Explanations as Programs in Probabilistic Logic Programming
The generation of comprehensible explanations is an essential feature of
modern artificial intelligence systems. In this work, we consider probabilistic
logic programming, an extension of logic programming which can be useful to
model domains with relational structure and uncertainty. Essentially, a program
specifies a probability distribution over possible worlds (i.e., sets of
facts). The notion of explanation is typically associated with that of a world,
so that one often looks for the most probable world as well as for the worlds
where the query is true. Unfortunately, such explanations exhibit no causal
structure. In particular, the chain of inferences required for a specific
prediction (represented by a query) is not shown. In this paper, we propose a
novel approach where explanations are represented as programs that are
generated from a given query by a number of unfolding-like transformations.
Here, the chain of inferences that proves a given query is made explicit.
Furthermore, the generated explanations are minimal (i.e., contain no
irrelevant information) and can be parameterized w.r.t. a specification of
visible predicates, so that the user may hide uninteresting details from
explanations.Comment: Published as: Vidal, G. (2022). Explanations as Programs in
Probabilistic Logic Programming. In: Hanus, M., Igarashi, A. (eds) Functional
and Logic Programming. FLOPS 2022. Lecture Notes in Computer Science, vol
13215. Springer, Cham. The final authenticated publication is available
online at https://doi.org/10.1007/978-3-030-99461-7_1
Concolic Execution and Test Case Generation in Prolog
The final publication is available at Springer via http://dx.doi.org/10.1007/978-3-319-17822-6_10Symbolic execution extends concrete execution by allowing symbolic input data and then exploring all feasible execution paths. It has been defined and used in the context of many different programming languages and paradigms. A symbolic execution engine is at the heart of many program analysis and transformation techniques, like partial evaluation, test case generation or model checking, to name a few. Despite its relevance, traditional symbolic execution also suffers from several drawbacks. For instance, the search space is usually huge (often infinite) even for the simplest programs. Also, symbolic execution generally computes an overapproximation of the concrete execution space, so that false positives may occur. In this paper, we propose the use of a variant of symbolic execution, called concolic execution, for test case generation in Prolog. Our technique aims at full statement coverage. We argue that this technique computes an underapproximation of the concrete execution space (thus avoiding false positives) and scales up better to medium and large Prolog applications.This work has been partially supported by the EU (FEDER) and the Spanish Ministerio de EconomÃa y Competitividad (SecretarÃa de Estado de Investigación, Desarrollo e Innovación) under grant TIN2013-44742-C4-1-R and by the Generalitat Valenciana under grant PROMETEO/2011/052.Vidal Oriola, GF. (2015). Concolic Execution and Test Case Generation in Prolog. En Logic-Based Program Synthesis and Transformation. Springer. 167-181. https://doi.org/10.1007/978-3-319-17822-6_10S167181Albert, E., Arenas, P., Gómez-Zamalloa, M., Rojas, J.M.: Test case generation by symbolic execution: basic concepts, a CLP-based instance, and actor-based concurrency. In: Bernardo, M., Damiani, F., Hähnle, R., Johnsen, E.B., Schaefer, I. (eds.) SFM 2014. LNCS, vol. 8483, pp. 263–309. Springer, Heidelberg (2014)Belli, F., Jack, O.: Implementation-based analysis and testing of Prolog programs. In: ISSTA, pp. 70–80. ACM (1993)Clarke, L.A.: A program testing system. In: Proceedings of the 1976 Annual Conference (ACM’76), Houston, pp. 488–491 (1976)De Schreye, D., Glück, R., Jørgensen, J., Leuschel, M., Martens, B., Sørensen, M.H.: Conjunctive partial deduction: foundations, control, algorithms, and experiments. J. Log. Program. 41(2&3), 231–277 (1999)Giesl, J., Ströder, T., Schneider-Kamp, P., Emmes, F., Fuhs, C.: Symbolic evaluation graphs and term rewriting: a general methodology for analyzing logic programs. In: PPDP’12, pp. 1–12. ACM (2012)Godefroid, P., Klarlund, N., Sen, K.: DART: directed automated random testing. In: Proceedings of PLDI’05, pp. 213–223. ACM (2005)Godefroid, P., Levin, M.Y., Molnar, D.A.: Sage: whitebox fuzzing for security testing. Commun. ACM 55(3), 40–44 (2012)Gómez-Zamalloa, M., Albert, E., Puebla, G.: Test case generation for object-oriented imperative languages in CLP. TPLP 10(4–6), 659–674 (2010)King, J.C.: Symbolic execution and program testing. Commun. ACM 19(7), 385–394 (1976)Leuschel, M.: The DPPD (Dozens of Problems for Partial Deduction) Library of Benchmarks. http://www.ecs.soton.ac.uk/mal/systems/dppd.html (2007)Lloyd, J.W.: Foundations of Logic Programming, 2nd edn. Springer, Berlin (1987)Lloyd, J.W., Shepherdson, J.C.: Partial evaluation in logic programming. J. Log. Program. 11, 217–242 (1991)Martens, B., Gallagher, J.: Ensuring global termination of partial deduction while allowing flexible polyvariance. In: Proceedings of ICLP’95, pp. 597–611. MIT Press (1995)Pasareanu, C.S., Rungta, N.: Symbolic PathFinder: symbolic execution of Java bytecode. In: Pecheur, C., Andrews, J., Di Nitto, E. (eds.) ASE, pp. 179–180. ACM (2010)Rojas, J.M., Gómez-Zamalloa, M.: A framework for guided test case generation in constraint logic programming. In: Albert, E. (ed.) Proceedings of LOPSTR. LNCS, vol. 7844, pp. 176–193. Springer, Heidelberg (2013)Sen, K., Marinov, D., Agha, G.: CUTE: a concolic unit testing engine for C. In: Proceedings of ESEC/SIGSOFT FSE 2005, pp. 263–272. ACM (2005)Ströder, T., Emmes, F., Schneider-Kamp, P., Giesl, J., Fuhs, C.: A linear operational semantics for termination and complexity analysis of . In: Vidal, G. (ed.) LOPSTR’11. LNCS, vol. 7225, pp. 237–252. Springer, Heidelberg (2012
Towards Symbolic Execution in Erlang
The final publication is available at Springer via http://dx.doi.org/10.1007/978-3-662-46823-4_28The concurrent functional language Erlang [1] has a number of distinguishing
features, like dynamic typing, concurrency via asynchronous message passing
or hot code loading, that make it especially appropriate for distributed, faulttolerant,
soft real-time applications. The success of Erlang is witnessed by the
increasing number of its industrial applications. For instance, Erlang has been
used to implement Facebook’s chat back-end, the mobile application Whatsapp
or Twitterfall—a service to view trends and patterns from Twitter—, to name
a few. The success of the language, however, also requires the development of
powerful testing and verification techniques.
Symbolic execution is at the core of many program analysis and transformation
techniques, like partial evaluation, test-case generation or model checking.
In this paper, we introduce a symbolic execution technique for Erlang. We discuss
how both an overapproximation and an underapproximation of the concrete
semantics can be obtained. We illustrate our approach through some examples.
To the best of our knowledge, this is the first attempt to formalize symbolic
execution in the context of this language, where previous approaches have only
considered exploring different schedulings but have not dealt with symbolic data.
More details can be found in the companion technical reportThis work has been partially supported by the Spanish Ministerio de EconomÃa y Competitividad (SecretarÃa de Estado de Investigación, Desarrollo e Innovación) under grant TIN2013-44742-C4-1-R and by the Generalitat Valenciana under grant PROMETEO/2011/052.Vidal Oriola, GF. (2015). Towards Symbolic Execution in Erlang. En Perspectives of System Informatics. Springer. 351-360. https://doi.org/10.1007/978-3-662-46823-4_28S35136
Fast Offline Partial Evaluation of Logic Programs
One of the most important challenges in partial evaluation is the design of automatic
methods for ensuring the termination of the process. In this work, we introduce sufficient
conditions for the strong (i.e., independent of a computation rule) termination and quasitermination
of logic programs which rely on the construction of size-change graphs. We
then present a fast binding-time analysis that takes the output of the termination analysis
and annotates logic programs so that partial evaluation terminates. In contrast to previous
approaches, the new binding-time analysis is conceptually simpler and considerably faster,
scaling to medium-sized or even large examples.
© 2014 Elsevier Inc. All rights reserved.This work has been partially supported by the Spanish Ministerio de Ciencia e Innovacion under grant TIN2008-06622-C03-02 and by the Generalitat Valenciana under grant PROMETEO/2011/052.Leuschel, M.; Vidal Oriola, GF. (2014). Fast Offline Partial Evaluation of Logic Programs. Information and Computation. 235:70-97. https://doi.org/10.1016/j.ic.2014.01.005S709723
A Framework for Computing Finite SLD Trees
The search space of SLD resolution, usually represented by means of a so-called SLD tree, is often infinite. However, there are many applications that must deal with possibly infinite SLD trees, like partial evaluation or some static analyses. In this context, being able to construct a finite representation of an infinite SLD tree becomes useful.
In this work, we introduce a framework to construct a finite data structure representing the (possibly infinite) SLD derivations for a goal. This data structure, called closed SLD tree, is built using four basic operations: unfolding, flattening, splitting, and subsumption. We prove some basic properties for closed SLD trees, namely that both computed answers and calls are preserved. We present a couple of simple strategies for constructing closed SLD trees with different levels of abstraction, together with some examples of its application. Finally, we illustrate the viability of our approach by introducing a test case generator based on exploring closed SLD trees.This work has been partially supported by the EU (FEDER) and the Spanish Ministerio de Economia y Competitividad (Secretaria de Estado de Investigacion, Desarrollo e Innovacion) under grant TIN2013-44742-C4-1-R and by the Generalitat Valenciana under grant PROMETEO/2011/052.Nishid, N.; Vidal Oriola, GF. (2015). A Framework for Computing Finite SLD Trees. Journal of Logical and Algebraic Methods in Programming. 84(2):197-217. https://doi.org/10.1016/j.jlamp.2014.11.006S19721784
Selective Unification in (Constraint) Logic Programming
[EN] Concolic testing is a well-known validation technique for imperative and object oriented programs. In a previous paper, we have introduced an adaptation of this technique to logic programming. At the heart of our framework lies a specific procedure that we call "selective unification". It is used to generate appropriate run-time goals by considering all possible ways an atom can unify with the heads of some program clauses. In this paper, we show that the existing algorithm for selective unification is not complete in the presence of non-linear atoms. We then prove soundness and completeness for a restricted version of the problem where some atoms are required to be linear. We also consider concolic testing in the context of constraint logic programming and extend the notion of selective unification accordingly.This work has been partially supported by the EU (FEDER) and the Spanish Ministerio de Ciencia, Innovacion y Universidades/AEI under grant TIN2016-76843-C4-1-R and by the Generalitat Valenciana under grant Prometeo/2019/098 (DeepTrust).Mesnard, F.; Payet, E.; Vidal, G. (2020). Selective Unification in (Constraint) Logic Programming. Fundamenta Informaticae. 177(3-4):359-383. https://doi.org/10.3233/FI-2020-1993S3593831773-
Concolic Testing in CLP
[EN] Concolic testing is a popular software verification technique based on a combination of concrete and symbolic execution. Its main focus is finding bugs and generating test cases with the aim of maximizing code coverage. A previous approach to concolic testing in logic programming was not sound because it only dealt with positive constraints (by means of substitutions) but could not represent negative constraints. In this paper, we present a novel framework for concolic testing of CLP programs that generalizes the previous technique. In the CLP setting, one can represent both positive and negative constraints in a natural way, thus giving rise to a sound and (potentially) more efficient technique. Defining verification and testing techniques for CLP programs is increasingly relevant since this framework is becoming popular as an intermediate representation to analyze programs written in other programming paradigms.This author has been partially supported by EU (FEDER) and Spanish MCI/AEI under grants TIN2016-76843-C4-1-R and PID2019-104735RB-C41, and by the Generalitat Valenciana under grant Prometeo/2019/098 (DeepTrust).Mesnard, F.; Payet, E.; Vidal, G. (2020). Concolic Testing in CLP. Theory and Practice of Logic Programming. 20(5):671-686. https://doi.org/10.1017/S1471068420000216S67168620
- …